import { http } from '@/common/service/service.js' 
import configService from '@/common/service/config.service.js';
const apiService = {
	 
	/**
	 *修改密码
	 */
	pwdedit(params) {
		return http.get('sys/updatePwd?'+params)
	},
	/**
	 * 获取最新公告
	 */
	getNewNotice() {
		return http.get('/bfOrderAudit/hqgg')
	}, 
	/**
	 *付款记录
	 */
	fkjl(id,moneyImg) {
		return http.post('/bfOrderAudit/fkjl?moneyImg='+moneyImg+"&id="+id)
	},
	 /**
	  *审核订单
	  */
	 check(id) {
	 	return http.post('/bfOrderAudit/check?id='+id)
	 },
	/**
	 *查询我的审核订单
	 */
	shenhedingdan(auditState,userId,keyword) {
		return http.post('/bfOrderAudit/shenhedingdan?auditState='+auditState+'&userId='+userId+'&keyword='+keyword)
	},
	/**
	 *查询我的申请记录
	 */
	sqjl(auditState,userId,keyword) {
		return http.post('/bfOrderAudit/sqjl?auditState='+auditState+'&userId='+userId+'&keyword='+keyword)
	},
	/**
	 * 添加好友
	 */
	jiahaoyou(auditInfoId) {
		return http.get('/bfOrderAudit/jiahaoyou?auditInfoId='+auditInfoId)
	},
	
	/**
	 *我的团队
	 */
	wodetuandui(userId) {
		return http.get('/bfOrderAudit/wodetuandui?userId='+userId)
	},
	/**
	 *创建审核单
	 */
	usertongji(userId) {
		return http.get('/bfOrderAudit/usertongji?userId='+userId)
	},
	
	/**
	 *创建审核单
	 */
	shenqinVip(userId) {
		return http.post('/bfOrderAudit/shenqinVip?userId='+userId)
	},
	 /**
	  * 注册
	  */
	 register(params) {
	 	return http.post('/sys/user/register',params)	
	 },
	 /**
	  * 根据ID查询手机号
	  * @param {Object} params 
	  */
	 getPhone(uid) {
	 	return http.get('/sys/getUserName?uid='+uid)	
	 }, 
	 /**
	  * 登录
	  */
	login(params) {
		return http.post('/sys/mLogin',params)	
	},
	/**
	  * 手机号码登录
	  */
	phoneNoLogin(params) {
		return http.post('/sys/phoneLogin',params);
	},
	/**
	  * 退出
	  */
	logout(params) {
		return http.post('/sys/logout',params);
	},
	/**
	 * 获取文件访问路径
	 * @param avatar
	 * @param subStr
	 * @returns {*}
	 */
	getFileAccessHttpUrl(avatar,subStr){
	    if(!subStr) subStr = 'http'
	    if(avatar && avatar.startsWith(subStr)){
	        return avatar;
	    }else{
	        return configService.staticDomainURL + "/" + avatar;
	    }
	}
};

export default apiService;
